
/*
 * Copyright 2002-2017 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2017原作者。
 *
 *根据Apache许可证2.0版（“许可证”）获得许可；
 *除非符合许可证，否则不得使用此文件。
 *您可以在以下地址获取许可证副本：
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证分发的内容是按“原样”分发的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限和
 *许可证下的限制。
 */

package org.springframework.beans;

import java.beans.PropertyDescriptor;

/**
 * The central interface of Spring's low-level JavaBeans infrastructure.
 *
 * <p>Typically not used directly but rather implicitly via a
 * {@link org.springframework.beans.factory.BeanFactory} or a
 * {@link org.springframework.validation.DataBinder}.
 *
 * <p>Provides operations to analyze and manipulate standard JavaBeans:
 * the ability to get and set property values (individually or in bulk),
 * get property descriptors, and query the readability/writability of properties.
 *
 * <p>This interface supports <b>nested properties</b> enabling the setting
 * of properties on subproperties to an unlimited depth.
 *
 * <p>A BeanWrapper's default for the "extractOldValueForEditor" setting
 * is "false", to avoid side effects caused by getter method invocations.
 * Turn this to "true" to expose present property values to custom editors.
 *
 * @author Rod Johnson
 * @author Juergen Hoeller
 * @since 13 April 2001
 * @see PropertyAccessor
 * @see PropertyEditorRegistry
 * @see PropertyAccessorFactory#forBeanPropertyAccess
 * @see org.springframework.beans.factory.BeanFactory
 * @see org.springframework.validation.BeanPropertyBindingResult
 * @see org.springframework.validation.DataBinder#initBeanPropertyAccess()
 */
/**
 *Spring底层JavaBeans基础设施的中心接口。
 *
 *＜p＞通常不直接使用，而是通过
 *｛@link org.springframework.beans.factory.BeanFactory｝或
 *｛@link org.springframework.validation.DataBinder｝。
 *
 *＜p＞提供分析和操作标准JavaBeans的操作：
 *获取和设置属性值的能力（单独或批量），
 *获取属性描述符，并查询财产的可读写性。
 *
 *此接口支持嵌套财产启用设置
 *子属性上财产的无限深度。
 *
 *＜p＞BeanWrapper的默认“extractOldValueForEditor”设置
 *为“false”，以避免getter方法调用引起的副作用。
 *将此设置设置为“true”以向自定义编辑器公开当前属性值。
 *
 *@作者Rod Johnson
 *@作者Juergen Hoeller
 *@自2001年4月13日起
 *@参见PropertyAccessor
 *@参见PropertyEditorRegistry
 *@see PropertyAccessorFactory#for BeanPropertyAccess
 *@参见org.springframework.beans.factory.BeanFactory
 *@参见org.springframework.validation.BeanPropertyBindingResult
 *@see org.springframework.validation.DataBinder#initBeanPropertyAccess（）
 */
public interface BeanWrapper extends ConfigurablePropertyAccessor {

	/**
	 * Specify a limit for array and collection auto-growing.
	 * <p>Default is unlimited on a plain BeanWrapper.
	 * @since 4.1
	 */
	/**
	 *指定阵列和集合自动增长的限制。
	 *＜p＞普通BeanWrapper的默认值是无限的。
	 *@自4.1
	 */
	void setAutoGrowCollectionLimit(int autoGrowCollectionLimit);

	/**
	 * Return the limit for array and collection auto-growing.
	 * @since 4.1
	 */
	/**
	 *返回数组和集合自动增长的限制。
	 *@自4.1
	 */
	int getAutoGrowCollectionLimit();

	/**
	 * Return the bean instance wrapped by this object.
	 */
	/**
	 *返回此对象包装的bean实例。
	 */
	Object getWrappedInstance();

	/**
	 * Return the type of the wrapped bean instance.
	 */
	/**
	 *返回包装的bean实例的类型。
	 */
	Class<?> getWrappedClass();

	/**
	 * Obtain the PropertyDescriptors for the wrapped object
	 * (as determined by standard JavaBeans introspection).
	 * @return the PropertyDescriptors for the wrapped object
	 */
	/**
	 *获取包装对象的PropertyDescriptors
	 *（由标准JavaBeans内省确定）。
	 *@return包装对象的PropertyDescriptors
	 */
	PropertyDescriptor[] getPropertyDescriptors();

	/**
	 * Obtain the property descriptor for a specific property
	 * of the wrapped object.
	 * @param propertyName the property to obtain the descriptor for
	 * (may be a nested path, but not an indexed/mapped property)
	 * @return the property descriptor for the specified property
	 * @throws InvalidPropertyException if there is no such property
	 */
	/**
	 *获取特定属性的属性描述符
	 *包装对象的。
	 *@param propertyName获取描述符的属性
	 *（可以是嵌套路径，但不是索引/映射属性）
	 *@返回指定属性的属性描述符
	 *如果没有这样的属性，@throws InvalidPropertyException
	 */
	PropertyDescriptor getPropertyDescriptor(String propertyName) throws InvalidPropertyException;

}
